Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessibility: Button pressed state and lists #940

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tskarhed
Copy link

Fixes #613 by adding a pressed state to the button.

Also adds lists for displaying, so a screen reader may know which item number you are currently at.

Preferably it would use tables and support arrow key navigation, as mentioned in #887, but that requires quite a lot of refactoring which will result in breaking changes.

@tskarhed
Copy link
Author

@wojtekmaj Is there anything else you need from me to make this happen?

@@ -120,6 +120,7 @@ export default function Tile(props: TileProps): React.ReactElement {
onMouseOver={onMouseOver ? () => onMouseOver(date) : undefined}
style={style}
type="button"
aria-pressed={!!classes?.find((classString) => classString.indexOf('--active') != -1 || classString.indexOf('--hasActive') != -1)}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the easiest way I could figure out how to check for the selected state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A11y: Add "aria-pressed" attribute to tile buttons
1 participant